Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Update checkpoint.py #299

Merged
merged 2 commits into from
Dec 21, 2018
Merged

Update checkpoint.py #299

merged 2 commits into from
Dec 21, 2018

Conversation

DIYer22
Copy link
Contributor

@DIYer22 DIYer22 commented Dec 21, 2018

if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise

FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n'

if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise 

```
FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n'
```
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 21, 2018
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks for the PR!

I left a comment, let me know what you think.

@@ -79,6 +79,7 @@ def get_checkpoint_file(self):
try:
with open(save_file, "r") as f:
last_saved = f.read()
last_saved = last_saved.replace("\n", "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using .strip() instead, would that be more robust (for example, on Windows)?

if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise
```
FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n'
```
Copy link
Contributor

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fmassa fmassa merged commit 9b6aa82 into facebookresearch:master Dec 21, 2018
nprasad2021 pushed a commit to nprasad2021/maskrcnn-benchmark that referenced this pull request Jan 29, 2019
* Update checkpoint.py

if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise 

```
FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n'
```

* Update checkpoint.py

if edit "{save_dir}/last_checkpoint" by vim, "\n" will auto append to the end of file. which will raise
```
FileNotFoundError: [Errno 2] No such file or directory: 'save_dir/model_0060000.pth\n'
```
@DIYer22 DIYer22 deleted the patch-2 branch February 15, 2019 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants